package com.chefu.operate.service.impl;

import com.chefu.operate.mapper.TweetMapper;
import com.chefu.operate.pojo.Tweet;
import com.chefu.operate.service.TweetService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author goodgoodstudy
 * @since 2021-03-30
 */
@Transactional
@Service
@Slf4j
public class TweetServiceImpl extends ServiceImpl<TweetMapper, Tweet> implements TweetService {

  @Autowired
  private TweetService tweetService;

    //查询
    public List<Tweet> findAll() {
        return list(null);
    }

    //添加
    public Tweet findByAdd(Tweet tweet) {
        //添加数据
        tweetService.save(tweet);
        return tweet;

    }

    //修改



    //删除
    public void findDelete(Integer tweetid) {
        tweetService.removeById(tweetid);
    }

}
